using System.Windows;
using System.Windows.Controls;

namespace WpfApp3.Tools.Helper
{
    internal static class ControlExtensions
    {
        public static void Show(this ContextMenu menu, bool show)
        {
            if (show)
            {
                menu.Visibility = Visibility.Visible;
                menu.IsEnabled = true;
            }
            else
            {
                menu.Visibility = Visibility.Collapsed;
                menu.IsEnabled = false;
            }
        }
    }
}
